from decimal import Decimal
from typing import List

def round(v, ndigits=2) -> float:
    return float(Decimal(float(v)).quantize(Decimal(str(pow(10,-ndigits))), rounding="ROUND_HALF_UP"))

def avg(array:List) -> float:
    if len(array) ==0:
        return 0

    return round(sum(array)/len(array),2)